package com.hougong.im.mapper;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.hougong.im.body.httpresponse.PersonMessageVo;
import com.hougong.im.body.httpresponse.PersonMsgUnreadVo;
import com.hougong.im.entity.PersonMessage;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 个人消息表 Mapper 接口
 * </p>
 *
 * @author lsz
 * @since 2018-08-25
 */
public interface PersonMessageMapper extends BaseMapper<PersonMessage> {

    List<PersonMessageVo>  selectHistoryFriendMessage(@Param("currentUid")Long currentUid, @Param("fid")Long fid);

    /**
     * 设置好友的消息为已读状态
     * @param currentUid
     * @param fid
     */
    void setFriedMessageHasRead(@Param("currentUid")Long currentUid, @Param("fid")Long fid);


    List<PersonMessageVo> selectUnReadMessage(@Param("currentUid")Long currentUid);

    /**
     * 第一次登录的时候 增加未读消息数量
     * @param currentUid
     * @return
     */
    List<PersonMsgUnreadVo> selectUnreadMessageCountMap(@Param("currentUid")Long currentUid);
}
